﻿@model MvcApplication2.Models.Recipe

@{
    ViewBag.Title = "Edycja";
}

<h2>Edycja przepisu</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Edit/"+Model.RecipeID, "Recipes", FormMethod.Post, new { enctype = "multipart/form-data" }))

{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Edycja:</legend>

        @Html.HiddenFor(model => model.RecipeID)
        @Html.HiddenFor(model => model.UserID)

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ImagePath)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(m => m.ImagePath, new { type = "file" })
            @Html.ValidationMessageFor(m => m.ImagePath)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description, new { cols = 35, @rows = 5 })
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Category)
        </div>
        <div class="editor-field">
            @Html.DropDownList("category1")
            @Html.ValidationMessageFor(model => model.Category)
        </div>

        <p>
            <input type="submit" value="Dodaj" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Wróć", "My")
</div>
